package com.cskaoyan.controller;


import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.bean.wxfootprint.vo.WxFootprintListVo;
import com.cskaoyan.service.wxfootprint.WxFootprintService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("wx/footprint")
public class WXFootprintController {

    @Autowired
    WxFootprintService wxFootprintService;

    @RequestMapping("list")
    public BaseRespVo list(Integer page, Integer size) {
       WxFootprintListVo result = wxFootprintService.listUserFootprint(page, size);

        return BaseRespVo.ok(result);
    }

    @RequestMapping("delete")
    public BaseRespVo delete(@RequestBody Map<String,Integer> map){
        Integer result = wxFootprintService.deleteFootPrint(map.get("id"));
        return result == 1 ? BaseRespVo.ok() : BaseRespVo.fail();
    }
}
